
//#include "LWP.h"
#include "LWP/Simple.h"
#include "HTTP.h"

#include <iostream>
#include <string>
#include <vector>
#include <iterator>
#include <algorithm>

using namespace std;
using namespace LWP::Simple;
using namespace LWP::Simple::POST;

void testget()
{
	string url = "www.google.com";
	string content = get(url);
	cout<<content.length()<<endl;
}

void testhead()
{
	vector<string> v;
	v = head("http://www.google.com");
	copy(v.begin(), v.end(), ostream_iterator<string>(cout, "\n"));
}

void testgetprint()
{
	string code = getprint("www.google.com");
	cout<<endl<<code<<endl;
}

void testgetstore()
{
	string code = getstore("http://www.google.com/intl/zh-CN_ALL/images/logo.gif", "google.gif");
	cout<<code<<endl;
}

void testpost()
{
//	cout<<post("http://www.google.com/search", "q=search")<<endl;
	post("http://www.google.com/search", "q=search");
	post_xml("http://www.google.com/search", "q=search");
}



int main()
{
	testget();

	return 0;
}

